<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserLevelsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_levels', function (Blueprint $table) {
            $table->increments('id');
            $table->string("level_name")->unique()->comment("平台等级");
            $table->string("level_title")->comment("职称");
            $table->integer("fund_ratio")->comment('基金比例%')->default(5);
            $table->integer("stock_ratio")->comment('股权比例%')->default(10);
            $table->integer("balance_ratio")->comment('差额比例%')->default(0);
            $table->float("same_ratio")->comment('同阶比例%')->default(0);
            $table->integer("area_ratio")->comment('区域比例%')->default(0);
            $table->string("update_string")->comment("升级说明")->default("");
            $table->boolean("auto_update")->comment("是否自动升级")->default(false);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_levels');
    }
}
